package com.example.algorithm.no0070.solution;

import com.example.algorithm.no0070.Solution;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @Description 解答实现-爬楼梯-递归
 * @ClassName SolutionImpl
 * @Author Administrator
 * @Date 2020/5/16 12:48
 * @Version 1.0.0
 */
public class SolutionImpl implements Solution {
    @Override
    public int climbStairs(int n) {
        return climb_Stairs(0, n);
    }

    public int climb_Stairs(int i, int n) {
        if (i > n) {
            return 0;
        }
        if (i == n) {
            return 1;
        }
        return climb_Stairs(i + 1, n) + climb_Stairs(i + 2, n);
    }
}
